package org.jeemp.thread;

/**
 * @author JackRen
 * @date 2021-03-04 9:56
 * @description:
 */
public class RunnableThread implements Runnable {
    private int i;

    @Override
    public void run() {
        for(i = 0;i <100;i++){
            System.out.println(Thread.currentThread().getName()+" "+i);
        }
    }

    public static void main(String[] args){
        for(int i = 0;i < 100;i++){
            System.out.println(Thread.currentThread().getName()+" "+i);
            if(i==20){
                RunnableThread runner= new RunnableThread();
                new Thread(runner,"新线程1").start();
                new Thread(runner,"新线程2").start();
            }
        }
    }
}
